#! /usr/bin/python

import sys

print sys.argv

if len(sys.argv) < 4 :
	print 'usage ./rsa.py e p q'
	exit()

var_e = int(sys.argv[1]) 
var_n = int(sys.argv[2]) * int(sys.argv[3])

var_M = 1234

#print pow(var_M, var_e) % var_n 

def detobin(num):
	lbin = []
	while(num):
		lbin.append( num % 2)
		num >>=1
	
	return lbin

le = detobin(var_e)

print le
power =	var_M % var_n 
value = 1
for i in range(0, len(le)):
	x = le[i]
	if x:
		value = (power * value) % (var_n)
	
	power = (power * power) % (var_n)
print '------------------resualt---------'
print value
